<template>
    <div>
        <div>
            <h3>{{comname}} &nbsp; ( {{comcode}} )</h3>
        </div>
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="投票建议" name="first">
                <ReportDetailCom v-if="!dataFlag" flag="1"/>
            </el-tab-pane>
            <el-tab-pane label="治理风险研究" name="second">
                <ReportDetailCom v-if="dataFlag" flag="2"/>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
import ReportDetailCom from './reportDetailCommon';
export default {
    name: 'reportDetail',
    data () {
        return {
            comname:'',
            comcode:'',
            activeName: 'first',
            dataFlag: false,
        }
    },
    methods: {
        handleClick(tab, event) {
            let id = event.target.id;
            if (id == 'tab-first') {
                this.dataFlag = false;
            }else if (id == 'tab-second') {
                this.dataFlag = true;
            }
        }
    },
    components: {
        ReportDetailCom
    },
    mounted(){
        this.comname = localStorage.getItem('comname');
        this.comcode = localStorage.getItem('comcode');
    }
}
</script>
<style lang="scss" scoped>

</style>


